<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/general.css"/>
		<link rel="stylesheet" type="text/css" href="../css/lcs-font.css"/>
		<style type="text/css">
			.ctext{
				position: absolute;
				top: 50%;
				right: 40px;
			    -webkit-transform: translateY(-50%);
			    transform: translateY(-50%);
			    padding: 0.3em;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav hbg">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left colorw"></a>
		    <h1 class="mui-title">权限报表</h1>
		</header>
		<div class="mui-content" id="poslist">
		    
		</div>
		<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/mui.min.js"></script>
		<script src="../js/req.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/muishow.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			
			
			window.onload = function(){
				mui.init();
				getpos();
			}
			function getpos(){
				var data = {
					url:"/api/role/lst",
					data:{
						access_token:acctoken(),
					}
				}
				ajax(data,function(res){
					console.log(res);
					setpos(res.data.data);
					
				})
			}
			function setpos(list){
				var str= '';
				if(list.length>0){
					
					str = '<ul class="mui-table-view">';
					for (var i = 0; i < list.length; i++) {
						str += '<li class="mui-table-view-cell" onclick="setrole('+list[i].id+')"><a class="mui-navigate-right">'+
			                    list[i].role_name+
			                '</a><span class="ctext fe09">权限设置</span></li>';
					}
					str +='</ul>';
				}else{
					str = '<div class="nolistdiv">请添加职位</div>'
				}
				
				g("poslist").innerHTML = str;
				
				
			}
			function setrole(rid){
				mui.openWindow({
				    url: 'employees/setpermission.html?rid='+rid, 
				    id: 'setpermission',
				 });
			}
		</script>
	</body>

</html>